package com.voice.server.job;

import com.voice.server.connection.ConnectionInvoke;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class DeviceWorkJob implements Job {

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        JobDataMap job=context.getJobDetail().getJobDataMap();
        JobDataMap detail=context.getTrigger().getJobDataMap();
        ConnectionInvoke connectionInvoke= (ConnectionInvoke) job.get("connectionInvoke");
        String topic=detail.getString("topic");
        String deviceKey=detail.getString("deviceKey");
        connectionInvoke.sendDeviceMessage(deviceKey,topic,null);
    }
}
